<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['收费管理','收费记录[弃用]']" icon="fa fa-list-alt" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>收费记录[弃用]</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width:calc(100% - 280px)">
								<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<!-- <div class="top_module top_module_box">
									<span class="module_text">车牌号码</span>
									<div class="s_hover_box">
										<select   class="select2"  id="carNumberSelect">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div> -->

								<div class="top_module top_module_box">
									<span class="top_module_label module_text">支付类型</span>
									<select name="" class="top_module_select" [(ngModel)]="tableSearch.payType">
										<option value=''>全部</option>
										<option value='0'>后付款</option>
										<option value='1'>预付款</option>
									</select>
								</div>

								<div class="top_module top_module_box">
									<span class="top_module_label module_text">费用类型</span>
									<select name="" class="top_module_select" [(ngModel)]="tableSearch.feeType">
										<option value=''>全部</option>
										<option value='0'>安装费</option>
										<option value='1'>维修费</option>
										<option value='2'>服务续费</option>
									</select>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">时间类型</span>
									<select name="" class="top_module_select" [(ngModel)]="tableSearch.dataType">
										<option value='1'>支付时间</option>
										<option value='2'>创建时间</option>
										<option value='3'>更新时间</option>
									</select>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">支付状态</span>
									<select name="" class="top_module_select" [(ngModel)]="tableSearch.tradeState">
										<option value='SUCCESS'>已支付</option>
										<option value='NOTPAY'>未支付</option>
										<option value=''>全部</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<table-select-date [notInit]='true' (outerTime)="getSelectTableTime($event)" ></table-select-date>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button class="btn btn-primary" (click)="exportTable()">导出</button>
							</div>
							<div class="right top-search" style="width: 280px;">
								<input type="text" [(ngModel)]="tableSearch.searchKey" (change)="table_search()" class="search-input" placeholder="车牌号、设备ID、商户订单、用户、手机">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>支付类型</th>
										<th>用户</th>
										<th>手机号码</th>
										<th>所属公司</th>
										<th>车牌号码</th>
										<th>设备ID</th>
										<th>商户订单号</th>
										<th>支付订单号</th>
										<th>商品名称</th>
										<th>总价[元]</th>
										<th>支付状态</th>
										<th>费用类型</th>
										<th>支付时间</th>
										<th>备注</th>
										<th>创建时间</th>
										<th>更新时间</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>{{row.payType==1?"预付款":"后付款"}}</td>
										<td>{{row.userName}}</td>
										<td>{{row.phone}}</td>
										<td>{{row.dockingFactoryName}}</td>
										<td>{{row.goodsName}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.outTradeNo}}</td>
										<td>{{row.transactionId}}</td>
										<td>{{row.goodsDetails}}</td>
										<td>{{row.totalPrice/100}}</td>
										<td>
											<span *ngIf="row.tradeState == 'SUCCESS'" class="green">支付成功</span>
											<span *ngIf="row.tradeState == 'REFUND'">转入退款</span>
											<span *ngIf="row.tradeState == 'NOTPAY'" class="orange">未支付</span>
											<span *ngIf="row.tradeState == 'CLOSED'">已关闭</span>
											<span *ngIf="row.tradeState == 'REVOKED'">已撤销</span>
											<span *ngIf="row.tradeState == 'USERPAYING'">用户支付中</span>
											<span *ngIf="row.tradeState == 'PAYERROR'" class="red">支付失败</span>
										</td>
										<td>
											<span *ngIf="row.feeTypes==0">安装费</span>
											<span *ngIf="row.feeTypes==1">维修费</span>
											<span *ngIf="row.feeTypes==2">服务续费</span>
										</td>
										<td>{{row.timeEnd}}</td>
										<td>{{row.remark}}</td>
										<td>{{row.createTime}}</td>
										<td>{{row.updateTime}}</td>
										<td>
											<button type="button" (click)="delRow(row)" *ngIf="delLimit">刪除</button>
											<button type="button" (click)="editRow(row,carNumberModal)">编辑</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
<!-- 弹窗-->
<section bsModal #carNumberModal="bs-modal"  id="carNumberModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" (click)="projectCarClose(carNumberModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">编辑</h4>
			</div>
			<form id="projectCarFrom"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
				<div class="modal-body">
					<div class="row form-horizontal">
						<!-- <div class="form-group s_fix_select2" >
							<label class="control-label col-sm-2 no-padding-right">车牌号码<sup>*</sup></label>
							<div class="col-sm-9">
								<div class="clearfix s_hover_box" style="width: 100%;">
									<input type="hidden"  class="form-control" id="carNumberInput" name="carNumberInput" [(ngModel)]='projectCarFrom.carNumber'>
									<select   class="select2 form-control" style="width:100%" name="carNumber" id="carNumberSelectInput">
										<option value=''></option>
									</select>
									<div class="s_del_icon" (click)='del_carNumber2()'>x</div>
								</div>
							</div>
						</div> -->
						<div class="form-group col-xs-12">
							<label class="col-xs-2 control-label">支付类型<sup>*</sup></label>
							<div class="col-xs-10">
								<label class="radio radio-inline" style="margin-right: 40px;">
									<input type="radio" class="radiobox" [checked]="editOrder.payType=='0'" (change)="payTypeChange($event.target.value)" value='0' name="payType">
									<span>后付款</span>
								</label>
								<label class="radio radio-inline" style="margin-right: 40px;">
									<input type="radio" class="radiobox" [checked]="editOrder.payType=='1'" (change)="payTypeChange($event.target.value)" value='1' name="payType">
									<span>预付款</span>
								</label>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="col-xs-2 control-label">费用类型<sup>*</sup></label>
							<div class="col-xs-10">
								<label class="radio radio-inline" style="margin-right: 40px;">
									<input type="radio" class="radiobox" [checked]="editOrder.feeTypes=='0'" (change)="typeExpenseChange($event.target.value)" value='0' name="typeExpense">
									<span>安装费</span>
								</label>
								<label class="radio radio-inline" style="margin-right: 40px;">
									<input [checked]="editOrder.feeTypes=='1'" type="radio" class="radiobox" (change)="typeExpenseChange($event.target.value)" value='1' name="typeExpense" [disabled]="editOrder.payType == 1">
									<span>维修费 </span>
								</label>
								<label class="radio radio-inline" style="margin-right: 40px;">
									<input [checked]="editOrder.feeTypes=='2'" type="radio" class="radiobox" (change)="typeExpenseChange($event.target.value)" value='2' name="typeExpense" [disabled]="editOrder.payType == 1">
									<!-- <input *ngIf="editOrder.payType != 1" [checked]="!isTypeExpense" type="radio" class="radiobox" (change)="typeExpenseChange($event.target.value)" value='3' name="typeExpense"> -->
									<span>服务续费</span>
								</label>
								<label class="radio radio-inline">
									<input [checked]="editOrder.feeTypes=='3'" type="radio" class="radiobox" (change)="typeExpenseChange($event.target.value)" value='3' name="typeExpense" [disabled]="editOrder.payType == 1">
									<span>对接费 </span>
								</label>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-2 no-padding-right">备注</label>
							<div class="col-sm-9">
								<div class="clearfix fix_select2">
									<textarea class="form-control" [(ngModel)]="editOrder.remark" name="remark"></textarea>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="projectCarClose(carNumberModal)">取消</button>
					<button type="button" class="btn btn-primary" (click)="projectCarSubmit(carNumberModal)">确认</button>
				</div>
			</form>
		</div>
	</div>
</section>
<!-- 弹窗end-->
</div>